package com.example.design.templateDemo;

public enum TemplateEnum {

    EAT("eat", "eatTemplate"),
    SELLP("sleep", "sleepTemplate");

    private String doCode;

    private String beanName;

    TemplateEnum(String doCode, String beanName) {
        this.doCode = doCode;
        this.beanName = beanName;
    }

    public static String getBeanName(String doCode) {
        for (TemplateEnum designEnum : TemplateEnum.values()) {
            if (designEnum.doCode.equals(doCode)) {
                return designEnum.beanName;
            }
        }
        return "";
    }

}
